<template>
  <div class="home">
    <img alt="Vue logo" src="../assets/logo.png">
    <!-- <router-link tag='button' to='/home/child1'>child1</router-link>
    <router-link to='/home/child2'>child2</router-link>

    <button @click='f1'> 异步 child1 </button>
    <button @click='f2'> 异步 child2 </button>
    <router-view></router-view> -->
  </div>
</template>

<script>
// @ is an alias to /src

export default {
  name: 'Home',
  created() {
    console.log('create')
  },
  methods: {
    f1(){
      setTimeout(() => {
        this.$router.push('/home/child1')
      }, 2000);
    },
    f2(){
      setTimeout(() => {
        this.$router.replace({path:'/home/child2'})
      }, 2000);
    }
  },
  components: {
  }
}
</script>
